package bjut.core.context;

import bjut.core.factory.DefaultListableBeanFactory;
import bjut.core.reader.XmlBeanDefinitionReader;

/**
 * @Author: zhuzhiming
 * @Date: 2022/5/26 18:24
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader xmlBeanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);

       String[] configLocations =  getConfigLocations();

       if(configLocations != null){
           xmlBeanDefinitionReader.loadBeanDefinitions(configLocations);
       }

    }

    protected abstract String[] getConfigLocations();

}
